package org.example.text04;

/**
 * 遥控器类
 */
public class Controller {
    private MediaPlayer[] players;
    public Controller(){

    }

    public Controller(MediaPlayer[] players) {
        this.players = players;
    }

    public MediaPlayer[] getPlayers() {
        return players;
    }

    public void setPlayers(MediaPlayer[] players) {
        this.players = players;
    }

    //对相应的设备调用 play 方法
    public void play(int i){
        players[i].play();
    }
    public void stop(int i){
        players[i].stop();
    }
    public void open(int i){
        players[i].open();
    }

}
